\(\int \csc ^6(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\) [54]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 93 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {\left (a^2+4 a b+b^2\right ) \cot (e+f x)}{f}-\frac {2 a (a+b) \cot ^3(e+f x)}{3 f}-\frac {a^2 \cot ^5(e+f x)}{5 f}+\frac {2 b (a+b) \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

-(a^2+4*a*b+b^2)*cot(f*x+e)/f-2/3*a*(a+b)*cot(f*x+e)^3/f-1/5*a^2*cot(f*x+e)^5/f+2*b*(a+b)*tan(f*x+e)/f+1/3*b^2
*tan(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3744, 459} \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {\left (a^2+4 a b+b^2\right ) \cot (e+f x)}{f}-\frac {a^2 \cot ^5(e+f x)}{5 f}+\frac {2 b (a+b) \tan (e+f x)}{f}-\frac {2 a (a+b) \cot ^3(e+f x)}{3 f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[In]

Int[Csc[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(((a^2 + 4*a*b + b^2)*Cot[e + f*x])/f) - (2*a*(a + b)*Cot[e + f*x]^3)/(3*f) - (a^2*Cot[e + f*x]^5)/(5*f) + (2
*b*(a + b)*Tan[e + f*x])/f + (b^2*Tan[e + f*x]^3)/(3*f)

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandI
ntegrand[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[p, 0] && IGtQ[q, 0]

Rule 3744

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2 \left (a+b x^2\right )^2}{x^6} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (2 b (a+b)+\frac {a^2}{x^6}+\frac {2 a (a+b)}{x^4}+\frac {a^2+4 a b+b^2}{x^2}+b^2 x^2\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {\left (a^2+4 a b+b^2\right ) \cot (e+f x)}{f}-\frac {2 a (a+b) \cot ^3(e+f x)}{3 f}-\frac {a^2 \cot ^5(e+f x)}{5 f}+\frac {2 b (a+b) \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.17 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.95 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {-\cot (e+f x) \left (8 a^2+50 a b+15 b^2+2 a (2 a+5 b) \csc ^2(e+f x)+3 a^2 \csc ^4(e+f x)\right )+5 b \left (6 a+5 b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{15 f} \]

[In]

Integrate[Csc[e + f*x]^6*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-(Cot[e + f*x]*(8*a^2 + 50*a*b + 15*b^2 + 2*a*(2*a + 5*b)*Csc[e + f*x]^2 + 3*a^2*Csc[e + f*x]^4)) + 5*b*(6*a
+ 5*b + b*Sec[e + f*x]^2)*Tan[e + f*x])/(15*f)

Maple [A] (verified)

Time = 3.98 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.46

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (f x +e \right )^{4}}{5}-\frac {4 \csc \left (f x +e \right )^{2}}{15}\right ) \cot \left (f x +e \right )+2 a b \left (-\frac {1}{3 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {4}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {8 \cot \left (f x +e \right )}{3}\right )+b^{2} \left (\frac {1}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}+\frac {4}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {8 \cot \left (f x +e \right )}{3}\right )}{f}\) \(136\)
default \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (f x +e \right )^{4}}{5}-\frac {4 \csc \left (f x +e \right )^{2}}{15}\right ) \cot \left (f x +e \right )+2 a b \left (-\frac {1}{3 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {4}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {8 \cot \left (f x +e \right )}{3}\right )+b^{2} \left (\frac {1}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}+\frac {4}{3 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {8 \cot \left (f x +e \right )}{3}\right )}{f}\) \(136\)
risch \(-\frac {16 i \left (10 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}-20 a b \,{\mathrm e}^{10 i \left (f x +e \right )}+10 b^{2} {\mathrm e}^{10 i \left (f x +e \right )}+25 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}+10 a b \,{\mathrm e}^{8 i \left (f x +e \right )}-35 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+16 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}+40 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+40 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}-2 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-20 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-10 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-2 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-20 a b \,{\mathrm e}^{2 i \left (f x +e \right )}-10 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+a^{2}+10 a b +5 b^{2}\right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{5} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(251\)

[In]

int(csc(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(a^2*(-8/15-1/5*csc(f*x+e)^4-4/15*csc(f*x+e)^2)*cot(f*x+e)+2*a*b*(-1/3/sin(f*x+e)^3/cos(f*x+e)+4/3/sin(f*x
+e)/cos(f*x+e)-8/3*cot(f*x+e))+b^2*(1/3/sin(f*x+e)/cos(f*x+e)^3+4/3/sin(f*x+e)/cos(f*x+e)-8/3*cot(f*x+e)))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.47 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {8 \, {\left (a^{2} + 10 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{8} - 20 \, {\left (a^{2} + 10 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{6} + 15 \, {\left (a^{2} + 10 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 10 \, {\left (3 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} - 5 \, b^{2}}{15 \, {\left (f \cos \left (f x + e\right )^{7} - 2 \, f \cos \left (f x + e\right )^{5} + f \cos \left (f x + e\right )^{3}\right )} \sin \left (f x + e\right )} \]

[In]

integrate(csc(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/15*(8*(a^2 + 10*a*b + 5*b^2)*cos(f*x + e)^8 - 20*(a^2 + 10*a*b + 5*b^2)*cos(f*x + e)^6 + 15*(a^2 + 10*a*b +
 5*b^2)*cos(f*x + e)^4 - 10*(3*a*b + b^2)*cos(f*x + e)^2 - 5*b^2)/((f*cos(f*x + e)^7 - 2*f*cos(f*x + e)^5 + f*
cos(f*x + e)^3)*sin(f*x + e))

Sympy [F]

\[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc ^{6}{\left (e + f x \right )}\, dx \]

[In]

integrate(csc(f*x+e)**6*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*csc(e + f*x)**6, x)

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.95 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {5 \, b^{2} \tan \left (f x + e\right )^{3} + 30 \, {\left (a b + b^{2}\right )} \tan \left (f x + e\right ) - \frac {15 \, {\left (a^{2} + 4 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} + 10 \, {\left (a^{2} + a b\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \]

[In]

integrate(csc(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/15*(5*b^2*tan(f*x + e)^3 + 30*(a*b + b^2)*tan(f*x + e) - (15*(a^2 + 4*a*b + b^2)*tan(f*x + e)^4 + 10*(a^2 +
a*b)*tan(f*x + e)^2 + 3*a^2)/tan(f*x + e)^5)/f

Giac [A] (verification not implemented)

none

Time = 0.66 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.28 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {5 \, b^{2} \tan \left (f x + e\right )^{3} + 30 \, a b \tan \left (f x + e\right ) + 30 \, b^{2} \tan \left (f x + e\right ) - \frac {15 \, a^{2} \tan \left (f x + e\right )^{4} + 60 \, a b \tan \left (f x + e\right )^{4} + 15 \, b^{2} \tan \left (f x + e\right )^{4} + 10 \, a^{2} \tan \left (f x + e\right )^{2} + 10 \, a b \tan \left (f x + e\right )^{2} + 3 \, a^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \]

[In]

integrate(csc(f*x+e)^6*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/15*(5*b^2*tan(f*x + e)^3 + 30*a*b*tan(f*x + e) + 30*b^2*tan(f*x + e) - (15*a^2*tan(f*x + e)^4 + 60*a*b*tan(f
*x + e)^4 + 15*b^2*tan(f*x + e)^4 + 10*a^2*tan(f*x + e)^2 + 10*a*b*tan(f*x + e)^2 + 3*a^2)/tan(f*x + e)^5)/f

Mupad [B] (verification not implemented)

Time = 10.74 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.97 \[ \int \csc ^6(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (a^2+4\,a\,b+b^2\right )+\frac {a^2}{5}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {2\,a^2}{3}+\frac {2\,b\,a}{3}\right )}{f\,{\mathrm {tan}\left (e+f\,x\right )}^5}+\frac {2\,b\,\mathrm {tan}\left (e+f\,x\right )\,\left (a+b\right )}{f} \]

[In]

int((a + b*tan(e + f*x)^2)^2/sin(e + f*x)^6,x)

[Out]

(b^2*tan(e + f*x)^3)/(3*f) - (tan(e + f*x)^4*(4*a*b + a^2 + b^2) + a^2/5 + tan(e + f*x)^2*((2*a*b)/3 + (2*a^2)
/3))/(f*tan(e + f*x)^5) + (2*b*tan(e + f*x)*(a + b))/f